#!/bin/bash

#msg=$(cat $1 | grep '<[a-z|A-Z]\{3,\}><\([a-z|A-Z|0-9]\+\)\(.*\)><\([a-z|A-Z|0-9|_|-]\+\)\([V\d|V\d.\d]\)\(.*\)>')
#echo $msg
if cat $1 | grep '<[a-z|A-Z]\{3,\}><\([a-z|A-Z|0-9]\+\)\(.*\)><\([a-z|A-Z|0-9|_|-]\+\)\(.*\)>'
then
    exit 0
else
  echo -e  "\033[47;45;5m 本地提交失败\033[0m"
  echo -e  "\033[33m 提交说明书写错误，正确的格式是: <类型(分FUNC/BUG/REQ/PATCH/MERGE)><Jira Key值><项目名称: 问题描述>\033[0m"
  echo -e  "\033[33m 示例: <REQ><SQZOIRUSSIA-22><S9201B_FLY_RU_4.2_V1.1：TP更新>\033[0m"
  echo -e  "\033[33m 示例: <BUG><ALL-114><S9201B_4.2_V1.1：TP无法使用和升级问题更新>\033[0m"
  echo -e  "\033[33m 示例: <PATCH><ALPS00743896><TINNO89_WE_JB2_ALPS.JB2.MP.V1.2_P67><用移动SIM卡上网，会弹出通知登录网络>\033[0m"
  exit 1
fi
